package top.lemos.navib;
import java.util.Calendar;
public class Time {
	static boolean  isrushhour()
	{
		Calendar now = Calendar.getInstance();
		int month=now.get(Calendar.MONTH) + 1;//note that calendar.month is one month earlier that actual one
		int day_of_week=now.get(Calendar.DAY_OF_WEEK);;
		int hour=now.get(Calendar.HOUR_OF_DAY);
		int min=now.get(Calendar.MINUTE);
		if(month!=7&&month!=8&&month!=2)
		{
			if(day_of_week!=1&&day_of_week!=7)//not Sunday or Saturday
			{
				switch(hour){
				case 8:
				{
					if(min>15&&min<30)
						return true;
					break;
				}
					
				case 10:
				{
					if(min>5&&min<20)
						return true;
					break;
				}			
				case 12:
				{
					if(min>0&&min<15)
						return true;
					break;
				}
				case 14:
				{
					if(min>20&&min<30)
						return true;
					break;
				}
				case 16:
				{
					if(min>0&&min<15)
						return true;
					break;
				}
				default:
					return false;
				}
			}
		}
		return false;
	}
}
